/* Top Bar */
// a.k.a. the panel

#panel {
  background-color: $panel_bg;
  font-weight: normal;
  height: $menuitem_size;
  box-shadow: 0 0 8px rgba(black, 0.2);
  color: $panel_fg;
  // font-feature-settings: "tnum";
  transition-duration: 250ms;
  text-shadow: none;
  @include font(body-1);

  // transparent panel on lock & login screens
  &:overview,
  &.unlock-screen,
  &.login-screen,
  &.lock-screen {
    box-shadow: none;
    background-color: if($trans == 'false' and $variant == 'light', transparent, transparent);
    box-shadow: none;

    StLabel, StIcon { color: $light_alt_fg_color; }

    .panel-button {
      &:hover {
        color: $light_fg_color;
        background-color: $light_divider_color;
        text-shadow: none;
      }

      &:active, &:overview, &:focus, &:checked {
        &, &:hover {
          color: $light_fg_color;
          background-color: $light_track_color;
          text-shadow: none;
        }
      }
    }

    .panel-corner {
      -panel-corner-radius: 0;
      -panel-corner-background-color: transparent;
      -panel-corner-border-color: transparent;
    }
  }

  // the rounded outset corners
  .panel-corner {
    -panel-corner-radius: 0;
    -panel-corner-background-color: $panel_bg;
    -panel-corner-border-width: 2px;
    -panel-corner-border-color: transparent;
    -panel-corner-opacity: 1;
    transition-duration: 250ms;
  }

  // panel menus
  .panel-button {
    -natural-hpadding: 8px;
    -minimum-hpadding: 8px;
    font-weight: normal;
    color: $panel_fg;
    text-shadow: none;
    transition-duration: 150ms;
    border-radius: 0;

    StLabel { padding: 0 2px; }

    &:hover {
      color: $panel_fg;
      background-color: $light_divider_color;
      text-shadow: none;
    }

    &:active, &:overview, &:focus, &:checked {
      &, &:hover {
        background-color: $primary_color;
        color: $light_alt_fg_color;
        text-shadow: none;
        box-shadow: none;
      }
    }

    .unlock-screen &,
    .login-screen &,
    .lock-screen & {
      color: $panel_fg;
      &:focus, &:hover, &:active { color: $panel_fg; }
    }

    &.clock-display {
      .clock {
        // transition-duration: 150ms;
        border: none;
        border-radius: 0;
        background: none;
        box-shadow: none;
      }
    }

    &:hover, &:active, &:overview, &:focus, &:checked {
      box-shadow: none;

      // The clock display needs to have the background on .clock because
      // we want to exclude the do-not-disturb indicator from the background
      &.clock-display {
        box-shadow: none;

        .clock {
          box-shadow: none;
        }
      }
    }

    // status area icons
    .system-status-icon {
      icon-size: $base_icon_size;
      padding: $base_padding;
      margin: 0;
    }

    .appindicator-trayicons-box { margin: 0 $base_padding; }

    // .panel-status-indicators-box .system-status-icon,
    // .panel-status-menu-box .system-status-icon {
    //   margin: 0;
    // }

    // .panel-status-indicators-box,
    // .panel-status-menu-box {
    //   spacing: 0;
    // }
  
    // spacing between power icon and (optional) percentage label
    // .power-status.panel-status-indicators-box {
    //   spacing: 0;
    // }

    // app menu icon
    .app-menu-icon {
      -st-icon-style: symbolic;
      // dimensions of the icon are hardcoded
    }

    &#panelActivities {
      -natural-hpadding: $base_padding * 3;
    }
  }

  // Input indicators
  Gjs_status_keyboard_InputSourceIndicator.panel-button, // Ibus
  Gjs_appindicatorsupport_rgcjonas_gmail_com_indicatorStatusIcon_AppIndicatorsIndicatorStatusIcon.panel-button { // Fcitx
    -natural-hpadding: 8px + $base_padding !important;
    -minimum-hpadding: 8px + $base_padding !important;
  }

  &.unlock-screen,
  &.login-screen,
  &:overview {
    .panel-button {
      &:hover, &:active, &:overview, &:focus, &:checked {
        box-shadow: none;

        &.clock-display {
          box-shadow: none;

          .clock {
            box-shadow: none;
          }
        }
      }
    }
  }

  // indicator for active
  .screencast-indicator,
  .remote-access-indicator { color: $warning_color; }
}

// Activities button
#panel #panelActivities.panel-button {
  > * {
    background-image: url("assets/activities.svg");
    background-position: center top;
    background-size: auto;
    width: 16px;
    padding: 0 !important;
    margin: 0 !important;
    background-color: transparent !important;
    background-gradient-direction: none !important;
    border: none;
    color: transparent;
  }

  &:active, &:overview, &:focus, &:checked {
    background-color: transparent;
    border: none;

    // > * { background-image: url("assets/activities-active.svg"); }
  }

  @if $variant == 'light' {
    &:overview {
      > * { background-image: url("assets/activities-white.svg"); }
    }
  }
}
